package com.youhong.teethcare;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.youhong.teethcare.settingpage.PersonalInfoActivity;
import com.youhong.teethcare.utils.AppManager;

public class ConnectIntroduceActivity extends BaseActivity {

    Button btn_ok;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_introduce);
        initStatusBar(getResources().getColor(R.color.pageBackground),true);

        if (AppManager.getInstance().getSpecificActivity(MainActivity.class) == null) {
            AppManager.getInstance().addActivity(this);
        }

        btn_ok = findViewById(R.id.connectIntroduce_btn_next);
        btn_ok.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                if (AppManager.getInstance().getSpecificActivity(MainActivity.class) != null) {
                    //同时关闭前一个页面，退回设置页面
                    AppManager.getInstance().killTopActivity();
                    ConnectIntroduceActivity.this.finish();

                } else {

                    Intent intent = new Intent(getApplicationContext(), PersonalInfoActivity.class);
                    startActivity(intent);

                }

            }
        });
    }


}
